package com.micro.train.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.sql.Time;

/**
 * 列车信息响应DTO
 * 用于返回标准格式的列车信息给其他微服务
 */
@Data
public class TrainResponseDTO {
    
    @JsonProperty("trainId")
    private Long trainId;
    
    @JsonProperty("trainNumber")
    private String trainNumber;
    
    @JsonProperty("departureStationId")
    private Long departureStationId;
    
    @JsonProperty("terminalStationId")
    private Long terminalStationId;
    
    @JsonProperty("departureTime")
    private String departureTime;
    
    @JsonProperty("arrivalTime")
    private String arrivalTime;
    
    public TrainResponseDTO() {}
    
    public TrainResponseDTO(Long trainId, String trainNumber, Long departureStationId, 
                           Long terminalStationId, Time departureTime, Time arrivalTime) {
        this.trainId = trainId;
        this.trainNumber = trainNumber;
        this.departureStationId = departureStationId;
        this.terminalStationId = terminalStationId;
        this.departureTime = departureTime != null ? departureTime.toString() : null;
        this.arrivalTime = arrivalTime != null ? arrivalTime.toString() : null;
    }
}
